@extends('new.layouts.indexPublic')
@section('title'){{$personal_search.Site::get('area_name').'找人才|人才简历库|'.Site::get('webname')}} @endsection
@section('headcss')
    <meta name="keywords" content="{{Site::get('homekeywords')}}">
    <meta name="description" content="{{Site::get('homedescription')}}">
    @parent
    <link rel="stylesheet" href="{{asset('/new/css/index/personnel.css')}}">
@endsection
{{--主体内容--}}
@section('content')
    {{--主导航--}}
    @include('new.layouts.mainNav')
    {{--主导航结束--}}

    {{--主要内容--}}
    <div class="main">
        <div class="wrapper">
            <div class="searchAndFilter">
                {{--搜索栏--}}
                <form id="resumeSearch" class="search" action="{{asset('/personnel')}}" name="resumeSearch" method="post">
                    {{csrf_field()}}
                    <input type="hidden" value="0" id="keyword_type" name="keyword_type" data-value="0">
                    {{--<input type="hidden" value="0" id="selArea" name="jobarea1" data-value="1">--}}
                    <div class="searchCont">
                        <div class="select" id="keyword_type_select" ><span><a>地区选择</a></span><i></i></div>
                        <input type="text" name="keyword" placeholder="请输入关键字"/>
                        <button type="submit">搜索</button>
                    </div>
                </form>
                {{--搜索栏结束--}}

                {{--筛选栏--}}
                <ul class="filter">
                    <li class="location">
                        <span>地区选择</span>
                        <div class="cont">
                            @if(count($area) > 0)
                                @foreach($area as $k=>$v)
                                    @if($v['check']==1)
                                        <a href="{{$v['url']}}" class="{{($v['text'] == '不限') ? 'noLimit':''}} selected">
                                            {{$v['text']}}
                                        </a>
                                    @else
                                        <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                    @endif
                                @endforeach
                            @endif
                        </div>
                        <input name="jobarea1" type="hidden" id="jobarea1" value="{{$input['jobarea1'] or ''}}">
                        <input name="jobarea2" type="hidden" id="jobarea2" value="{{$input['jobarea2'] or ''}}">
                        <input name="jobarea3" type="hidden" id="jobarea3" value="{{$input['jobarea3'] or ''}}">
                        <input name="jobarea4" type="hidden" id="jobarea4" value="{{$input['jobarea4'] or ''}}">
                        <input name="jobarea5" type="hidden" id="jobarea5" value="{{$input['jobarea5'] or ''}}">
                        <a id="areamore" class="more" href="javascript:void(0)">更多<i></i></a>
                    </li>
                    <li class="welfare">
                        <span>工作年限</span>
                        <div class="cont">
                            @if(count($work_year) > 0)
                                @foreach($work_year as $k=>$v)
                                    @if($v['value']==$input['work_year'])
                                        <a href="{{$v['url']}}" class="{{($v['text'] == '不限') ? 'noLimit':''}} selected">
                                            {{$v['text']}}
                                            {{--@if($v['text'] != '不限')--}}
                                                {{--<i></i>--}}
                                            {{--@endif--}}
                                        </a>
                                    @else
                                        <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                    @endif
                                @endforeach
                            @endif
                        </div>
                    </li>
                    <li class="salary">
                        <span>年龄</span>
                        <div class="cont">
                            @if(count($age) > 0)
                                @foreach($age as $k=>$v)
                                    @if($v['value']==$input['age'])
                                        <a href="{{$v['url']}}" class="{{($v['text'] == '不限') ? 'noLimit':''}} selected">
                                            {{$v['text']}}
                                            {{--@if($v['text'] != '不限')--}}
                                                {{--<i></i>--}}
                                            {{--@endif--}}
                                        </a>
                                    @else
                                        <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                    @endif
                                @endforeach
                            @endif
                        </div>
                    </li>
                    <li class="others">
                        <span>其 它<i></i></span>
                        <div class="cont">
                            <a href="" class="noLimit selected">不限</a>
                            <div class="selectIndustry" id="industrymore">
                                <input name="jobsort1" type="hidden" id="jobsort1" value="{{$input['jobsort1'] or ''}}">
                                <input name="jobsort2" type="hidden" id="jobsort2" value="{{$input['jobsort2'] or ''}}">
                                <input name="jobsort3" type="hidden" id="jobsort3" value="{{$input['jobsort3'] or ''}}">
                                <input name="jobsort4" type="hidden" id="jobsort4" value="{{$input['jobsort4'] or ''}}">
                                <input name="jobsort5" type="hidden" id="jobsort5" value="{{$input['jobsort5'] or ''}}">
                                <input type="text" name="jobsort" id="jobsortmore" value="{{$cninput['jobsort'] or ''}}" readonly style="cursor:pointer" placeholder="工作岗位不限" aria-invalid="false" class="valid">
                                <i></i>
                            </div>

                            {{--选择性别--}}
                            <input id="sex" name="sex" type="hidden" value="{{$input['sex'] or ''}}">
                            <div id="sex_select" class="select"><span><a></a></span><i></i></div>
                            {{--学历--}}
                            <input id="education" name="education" type="hidden" value="{{$input['education'] or ''}}">
                            <div id="education_select" class="select"><span><a></a></span><i></i></div>
                            {{--现在所居地--}}
                            <input id="homeaddress" name="homeaddress" type="hidden" value="{{$input['homeaddress'] or ''}}">
                            <div id="homeaddress_select" class="select"><span><a></a></span><i></i></div>
                            {{--户籍--}}
                            <input id="census" name="census" type="hidden" value="{{$input['census'] or ''}}">
                            <div id="census_select" class="select"><span><a></a></span><i></i></div>
                        </div>
                    </li>
                </ul>
                {{--筛选栏结束--}}
            </div>

            <div class="resumesList">
                <div class="top">
                    <div class="resumesSum">共<strong>{{ $resumeinfo->total() }}+</strong>简历</div>
                    <div class="checkBox">
                        <label for="experienced">工作经验</label><input id="experienced" type="checkbox" @if($input['haveworkexp']!='')checked @endif>
                        <label for="hasPhoto">有照片</label><input id="hasPhoto" type="checkbox" @if($input['chkphoto_open']!='')checked @endif>
                    </div>
                    <div class="sequence">
                        <a data-value="0" class="byTime selected" href="javascript:void(0)"><i></i><span>时间排序</span></a>
                        <a data-value="1" class="bySynthesis" href="javascript:void(0)"><i></i><span>综合排序</span></a>
                    </div>
                    {{--<div class="pageNum">< <strong>1</strong>/6 ></div>--}}
                </div>
                <ul class="lists">
                    <li class="title">
                        <div class="selectBtn"></div>
                        <div class="name">姓名</div>
                        <div class="baseInfo">基本资料</div>
                        <div class="intentionJobs">意向岗位</div>
                        <div class="workPlace">工作地</div>
                        <div class="updateTime">更新时间</div>
                    </li>
                    @if(count($resumeinfo)>0)
                        @foreach($resumeinfo as $k=>$v)
                            <li>
                                <div class="selectBtn">
                                    <input id="checkbox{{ $k }}" type="checkbox" name="checkbox{{ $k }}" value="{{ idEncryption($v->id) }}">
                                </div>
                                <div class="name">
                                    <a href="{{ url("/resume_".idEncryption($v->id).".html") }}" target="_blank">
                                        @if(!auth()->guard('company')->check())
                                            @if($v->sex == '男' )
                                                {{ mb_substr($v->name,0,1)}}先生
                                            @else
                                                {{ mb_substr($v->name,0,1)}}女士
                                            @endif
                                        @else
                                            {{ $v->name }}
                                        @endif
                                    </a>
                                    @if(!empty($v->avatar) && $v->avatar!='/default/images/index/defualt_person_img.png')
                                        <img src="{{asset('/new/images/icon/withAvatar.png')}}">
                                    @endif
                                </div>
                                <div class="baseInfo">
                                    <span>@if(!empty($v->sex)){{ $v->sex }}@else未填写@endif</span><span>|</span>
                                    <span>@if(!empty($v->birthday)){{ $v->birthday }}@else未填写@endif</span><span>|</span>
                                    <span>@if(!empty($v->education)){{ $v->education }}@else未填写@endif</span><span>|</span>
                                    <span>@if(!empty($v->work_year)){{ $v->work_year }}@else未填写@endif</span><span>|</span>
                                    <span>@if(!empty($v->homeaddress)){{ $v->homeaddress }}@else未填写@endif</span>
                                </div>
                                <div class="intentionJobs"><span>{{ str_limit($v->intentionjobs, 22) }}</span></div>
                                <div class="workPlace">
                                    @if(!empty($v->jobarea1)){{ $v->jobarea1 }}@endif
                                    @if(!empty($v->jobarea2))/@endif{{ $v->jobarea2 }}
                                    @if(!empty($v->jobarea3))/@endif{{ $v->jobarea3 }}
                                    @if(!empty($v->jobarea4))/@endif{{ $v->jobarea4 }}
                                    @if(!empty($v->jobarea5))/@endif{{ $v->jobarea5 }}
                                </div>
                                <div class="updateTime">{{ $v->updatetime or '' }}</div>
                            </li>
                        @endforeach
                        <li class="seeResumes">
                            <div class="box">
                                <input id="selectAll" class="selectAll" type="checkbox"><label for="selectAll">全选</label>
                            </div>
                            <button id="seeResumes">批量查看</button>
                        </li>
                        <li class="page">{!! $page !!}</li>
                    @else
                        <li class="no-one">
                            <img src="{{ asset("/default/images/index/bgpic.jpg") }}">
                            <p>对不起,没有符合条件的记录!</p>
                        </li>
                    @endif
                </ul>
            </div>
        </div>
    </div>
    <?php
    ?>
    {{--主要内容--}}
@endsection
{{--职位列表js--}}
@section('js')
    @parent
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{asset('/vendor/org/layer/layer.js')}}"></script>
    {{--<script type="text/javascript" src="{{asset('/default/js/jquery/jquery.calling.js')}}"></script>--}}
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.area.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.position.js')}}"></script>
    <script type="text/javascript" src="{{'/new/js/index/personnel.js'}}"></script>
    <script>
        var siteArea= '{!! $areaForJson !!}';
        //现居住地select json
        var areaForHomeAddress = {!! $areaForJson !!};
        areaForHomeAddress.unshift({"value":'',"text":"现居住地不限","selected":true});
        //户藉select json
        var areaForHouseHolds = {!! $areaForJson !!};
        areaForHouseHolds.unshift({"value":'',"text":"户藉不限","selected":true});
        areaForHouseHolds.push({"value":'other',"text":"其他"});

        //地区
        var jobarea_url='{!!$optionsurl['jobarea']!!}';
        //行业
        var jobsort_url='{!!$optionsurl['jobsort']!!}';
        //性别
        var sex_url = '{!! $optionsurl['sex'] !!}';
        //学历
        var education_url = '{!! $optionsurl['education'] !!}';
        //现所在地
        var homeaddress_url = '{!! $optionsurl['homeaddress'] !!}';
        //户藉
        var census_url = '{!! $optionsurl['census'] !!}';
        //显示详细信息
        var havedetails_url = '{!! $optionsurl['havedetails'] !!}';
        //有照片
        var chkphoto_open_url = '{!! $optionsurl['chkphoto_open'] !!}';
        //有工作经验
        var haveworkexp_url = '{!! $optionsurl['haveworkexp'] !!}';
        //智能排序
        var sortdesc_url = '{!! $optionsurl['sortdesc'] !!}';

        $(function(){
            //筛选栏地区选择中更多按钮点击事件
            $("#areamore").click(function(){
                workplaceInputGet('');
                if($('.posCategories .cateType dt').length > 0){
                    $('.posCategories .cateType dt').css('height','489px!important');
                }
            });
            //筛选栏其他选项中选择岗位按钮
            $("#industrymore").click(function(){
                posCateInputGet('');
            });

            //排序按钮高亮
            var sortdesc = GetQueryString('sortdesc');
            if(sortdesc == 0){
                $('.resumesList .top .sequence a').removeClass('selected').eq(0).addClass('selected');
            }else{
                $('.resumesList .top .sequence a').removeClass('selected').eq(1).addClass('selected');
            }
        });
        //更多弹出框选择值获取及操作
        function workplaceInputGet(randfrm){
            var workarr = {
                objId: '#jobLoc'+randfrm,					//当前显示内容的ID值
                objProvince: 'address_P'+randfrm,	        //当前select省份
                objCity: 'address_C'+randfrm,		        //当前select市区县
                objCate:'#locCate'+randfrm,					//当前页面弹出层显示要追加的工作地区类别内容
                objTwoCate:'#twolocCate'+randfrm,		    //当前页面要追加的工作地区类别内容
                objChcekbox:'#jobLocations'+randfrm,	    //当前弹出层 复选框checkbox的前缀名id值
                objSelect:'locSelect'+randfrm,				//当前弹出层 追加到弹出要追加的内容里面的ID前缀值
                objTwoSelect:'twolocSelect'+randfrm,	    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
                objPostCate:'#workplace',					//当前页面  追加到当前页面input要追加的内容里面的ID前缀值
                objArr : ["#jobarea1"+randfrm,"#jobarea2"+randfrm,"#jobarea3"+randfrm,"#jobarea4"+randfrm,"#jobarea5"+randfrm], //当前隐藏表单
                keep_sceen :'#keep_sceen',					//遮掩层
                objLevel:'3',								//设置当前显示的级别
                objInpaLength:'5',							//设置当前input 表单选项的个数
                callback:function(val,text){
                    var urlget='';
                    $.each(val,function(k,v){
                        k++;
                        if(v!=''){
                            if(k!=1) urlget+='&';
                            urlget+='jobarea'+k+'='+v;
                        }else{
                            return false;
                        }
                    });
                    var exl="?";
                    if(jobarea_url.indexOf("?") > 0 ){
                        exl='&';
                    }
                    window.location=jobarea_url+exl+urlget;
                }
            };
            workObj.showextend(randfrm,workarr);
        }

        //选择岗位弹出框中岗位选择及操作
        function posCateInputGet(randfrm,selmod){
            var arrobj = {
                objId: '#jobFun'+randfrm,					        //当前显示内容的ID值
                objCate:'#funCate'+randfrm,					        //当前页面弹出层显示要追加的岗位类别内容
                objTwoCate:'#twofunCate'+randfrm,				    //当前页面要追加的岗位类别内容
                objChcekbox:'#jobFunctions'+randfrm,			    //当前弹出层 复选框checkbox的前缀名id值
                objSearchChcekbox:'#jobFunctionSearch'+randfrm,     //当前弹出层 复选框checkbox的前缀名id值 搜索的复选框
                objSelect:'funSelect'+randfrm,				        //当前弹出层 追加到弹出要追加的内容里面的ID前缀值
                //objTwoSelect:'twofunSelect'+randfrm,			    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
                objPostCate:'#jobsort',                             //当前页面  追加到当前页面input要追加的内容里面的ID前缀值
                objArr : ["#jobsort1"+randfrm,"#jobsort2"+randfrm,"#jobsort3"+randfrm,"#jobsort4"+randfrm,"#jobsort5"+randfrm], //当前隐藏表单
                keep_sceen :'#keep_sceen',					        //遮掩层
                objLevel:'2',								        //设置当前显示的级别
                objType:'1',								        //设置当前显示的类型
                objMod:selmod,                                      //选择模式 当传入值为1时。出现大类不限
                objInpaLength:'5',								    //设置当前input 表单选项的个数
                callback:function(val,text){
                    var urlget='';
                    $.each(val,function(k,v){
                        k++;
                        if(v!=''){
                            if(k!=1) urlget+='&';
                            urlget+='jobsort'+k+'='+v;
                        }else{
                            return false;
                        }
                    });
                    var exl="?";
                    if(jobsort_url.indexOf("?") > 0 ){
                        exl='&';
                    }
                    window.location=jobsort_url+exl+urlget;
                }
            };
            cateObj.showextend(randfrm,arrobj);
        }
    </script>
@endsection